<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/common.css">
	</head>

	<body style="padding: 0px;">
		<div class="easyui-layout" style="width:100%;height:550px;">
			<div data-options="region:'north'" style="height:90px;">
				<div id="p" class="easyui-panel" title="查询" style="width:100%;height:100%;padding:15px;">
					<table cellspacing="4">
						<tr>
							<td>源库房</td>
							<td>
								<input class="easyui-combobox" id="search_fromstorehouse" name="FROMSTOREHOUSE_NAME" />
							</td>
							<td>目标库房</td>
							<td>
								<input class="easyui-combobox" id="search_tostorehouse" name="TOSTOREHOUSE_NAME" />
							</td>
							<td>建单人</td>
							<td>
								<input class="easyui-combobox" id="search_man" name="CREATE_MAN" />
							</td>
							<td>
								<a href="#" class="easyui-linkbutton" onclick="doSearch()" data-options="iconCls: 'icon-search'" style="width:80px;">查询</a>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<div data-options="region:'center'">
				<div id="p" class="easyui-panel" style="width:100%;height:100%;padding:0px;">
					<div class="easyui-tabs" id="div_tabs" style="width: 100%;">
						<div title="移库单据列表" style="overflow:hidden ">
							<iframe id="ifrmList" src="StockTransferOrderList.html" style="width: 100%;height: 350px;" frameborder="0" scrolling="no"></iframe>
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
	<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../../JS/common.js"></script>
	<script type="text/javascript">
	$('#search_fromstorehouse').combobox({
			valueField: 'ID',
			textField: 'NAME',
			panelHeight: 'auto',
			mode: 'remote',
			method: 'get',
			url: RemoteLinkAddress + "/logistics/storehouse/listall.do",
			onSelect: function(record) {
				$("#search_fromstorehouse").textbox("setValue", record.NAME);
			}
	});
	
	$("#search_tostorehouse").combobox({
			valueField: 'ID',
			textField: 'NAME',
			panelHeight: 'auto',
			mode: 'remote',
			method: 'get',
			url: RemoteLinkAddress + "/logistics/storehouse/listall.do",
			onSelect: function(record) {
				$("#search_tostorehouse").textbox("setValue", record.NAME);
			}
	});
		function doSearch() {
			var searchCondition = "";
			if($("#search_fromstorehouse").combobox("getValue").length != 0) {
				searchCondition = "FROMSTOREHOUSE_NAME=" + encodeURI($(" #search_fromstorehouse").combobox("getValue"));
			}
			if($("#search_tostorehouse").combobox("getValue").length != 0) {
				if(searchCondition == " ") {
					searchCondition = "TOSTOREHOUSE_NAME=" + $("#search_tostorehouse").combobox("getValue");
				} else {
					searchCondition = searchCondition + "&TOSTOREHOUSE_NAME=" + $(" #search_tostorehouse").combobox("getValue");
				}
			}
			if($("#search_man").combobox("getValue").length != 0) {
				if(searchCondition == "") {
					searchCondition = "CREATE_MAN=" + $(" #search_man").combobox("getValue");
				} else {
					searchCondition = searchCondition + "&CREATE_MAN=" + $(" #search_man").combobox("getValue");
				}
			}
			_url = RemoteLinkAddress + '/logistics/stocktransferorder/list.do?' + searchCondition;
			$("#ifrmList")[0].contentWindow.$('#dg').datagrid('options').url = _url;
			$("#ifrmList")[0].contentWindow.$('#dg').datagrid('reload');
		}
	</script>
</html>